
/* GCSx
** LAYERPROP.H
**
** Layer properties dialog
*/

/*****************************************************************************
** Copyright (C) 2003-2006 Janson
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
** 
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
*****************************************************************************/

#ifndef __GCSx_LAYERPROP_H_
#define __GCSx_LAYERPROP_H_

// This radio modifies other controls according to state
// It's actions are specific to this properties dialog
class LayerPropertiesRadioButton : public WRadioButton {
public:
    LayerPropertiesRadioButton(int rId, const std::string& rLabel, int* rSetting, int rValue);
    int state(int checked = -1, int fromLoad = 0);    
};

class LayerPropertiesDialog : private Dialog {
public:
    enum {
        ID_LABEL = 1,
        ID_NAME,
        ID_TYPE,
        ID_WIDTH,
        ID_HEIGHT,
        ID_SIZELABEL,
        ID_TILESET,
        ID_EXTENDED,
        ID_EFFECTS,
        ID_OK,
        ID_CANCEL,
    };

    static class LayerPropertiesDialog* dialog;

private:
    int initialized;
    const class LayerEdit* layer;

public:
    LayerPropertiesDialog();

    static class LayerPropertiesDialog* create();
    static void destroy();

    int run(int allowTypeChange, Layer::LayerType* type, std::string* title, int* xSize, int* ySize, int* tilesetId, int* usesExtended, int* usesEffects, const LayerEdit* whichLayer);
    ButtonAction verifyEntry(int buttonId, ButtonAction buttonType);
};

#endif

